﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AP.Framework.Infrastructure.Repositories.IRepositories;
using AP.Framework.Infrastructure.Entities;
using AP.Web.Common;

namespace AP.Web.Controllers
{
    [ApWebHandleErrorAttribute]
    public class CompanyController : Controller
    {
        ICompanyProfile _profile;
        public CompanyController(ICompanyProfile profile)
        {
            _profile = profile;
        }
        public ActionResult Index()
        {
            cms_CompanyProfile model = _profile.GetAll().OrderBy(p => p.Sequence).FirstOrDefault();
            return View(model);
        }
        public ActionResult ViewDetails(int? companyId)
        {
            cms_CompanyProfile model = _profile.GetAll().Where(p => p.ID == companyId).FirstOrDefault();
            return View(model);

        }
    }
}
